const setToken = (token)=>sessionStorage.setItem("token",token);

const getToken = ()=>sessionStorage.getItem("token");

const removeToken = ()=>sessionStorage.removeItem("token");

const isLogined = ()=> (getToken()?true:false);
// 设置本地存储地址信息

/**
 * 
 * @param 记得再存入本地的时候需要将对象转换为json字符串
 * @returns  同时在取出的时候记得转转换为对象
 */
const setAddress = (addre)=>localStorage.setItem("address",JSON.stringify(addre));

const getAddress = ()=>JSON.parse(localStorage.getItem("address"));

const removeAddress = () => localStorage.removeItem("address");

export {setToken,getToken,removeToken,isLogined,setAddress,getAddress,removeAddress};